<?php
namespace Admin\Controller;
class IndexController extends BaceController{
 /* 
  * 查出登录名称属于哪个角色
  *  
  */   
      public function rbac(){
        $where=array(
          'uid'=>$_COOKIE['id'],  
        );
       $role_id= M('User_role')->where($where)->field("role_id")->select();
       foreach ($role_id as $v) {
          $id=$v['role_id'];
       }
        $re=M('Role')->where("id=$id")->field("name")->select();
        foreach ($re as $v){
            $name=$v['name'];
        }
          $this->assign("name",$name);
         
        $this->display();
        
        
    }
 
}